/*
 * Copyright 2002-2015 the Beijing Brain Technology co.,LTD http://www.bris.cn/
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bris.niosocket.message;

/**
 * 编解码接口,定义基本的编解码规则,负责将消息编解码成上层/底层数据</br>
 * 2015年11月26日</br>
 * @author xunaidong
 * @since 1.0.0
 */
public interface Codecable {
	
	String UTF8 = "UTF-8";
	String GB2312 = "GB2312";
	String GBK = "GBK";
	String ASCII = "ASCII";
	/**命令数据编码所占字节位数*/
	int COMMAND_ID_LEN = 4;
	/**报文编码长度所占字节位数*/
	int PACKET_LENGTH_FIELD_LEN = 4;//报文长度所占字节位数
	/**编码版本号*/
	byte VERSION = 0;//默认版本号
	/**编码状态*/
	short STATUS = 0;//默认状态码
	/**报文数据编码前缀长度*/
	int ENCODE_BODY_PRFIX_LENGTH = 8;//编码前缀长度,
	
	

    /**
     * 获取字符编码<br/> 
     * 
     * @author xunaidong 
     * @return 
     * @since 1.0.0
     */
    String getEncoding();
}
